#ifndef stats_h
#define stats_h

#if HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdint.h>

#if LAGGARD_STATS
# define STAT_REPORT(code) do { ++stat_counters[code]; } while(0)
#else
# define STAT_REPORT(code) do { ; } while(0)
#endif

enum stat_codes {
  stat_none = 0,
  stat_nodes,
  stat_interrupted_nodes,
  stat_terminal_nodes,
  stat_nonterminal_nodes,
  stat_interior_nodes,
  stat_pv_nodes,
  stat_pv_best,
  stat_alpha_nodes,
  stat_beta_nodes,
  stat_tt_nodes,
  stat_tt_best,
  stat_tt_beta_nodes,
  stat_iid_searches,
  stat_iid_best,
  stat_iid_beta_nodes,
  stat_null_tests,
  stat_null_pruning,
  stat_futility_pruning,
  stat_extended_nodes,
  stat_lmr_moves,
  stat_hash_probe,
  stat_hash_hit,
  stat_pawn_hash_probe,
  stat_pawn_hash_hit,
  stat_material_hash_probe,
  stat_material_hash_hit,
  stat_last
};

extern int64_t stat_counters[stat_last];

void stat_init();
void stat_print();


#endif  // stats_h
